package com.euc.springbootframework.service.auth;

import com.euc.springbootframework.dao.UserDao;
import com.euc.springbootframework.dao.base.BaseDao;
import com.euc.springbootframework.entity.User;
import com.euc.springbootframework.service.base.RestBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService  extends RestBaseService<User> {


    @Autowired
    private UserDao userBaseDao;


    @Override
    protected BaseDao<User, String> getRepository() {
        return userBaseDao;
    }


    public User findByUsernameAndPassword(String username,String password){
        return userBaseDao.findByUsernameAndPassword(username, password);
    }

    public User findByUsername(String username){
        return userBaseDao.findByUsername(username);
    }
}
